package com.cast.n2.n3;

import lombok.extern.slf4j.Slf4j;

import static com.cast.n2.util.Sleeper.sleep;

/**
 * @program: juc
 * @description:
 * @author: lishuang
 * @create: 2021-10-19 14:45
 **/
@Slf4j(topic = "c.TestTea")
public class TestTea {
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            sleep(1);
            log.debug("洗水壶");
            sleep(15);
            log.debug("烧水");
        }, "老王");
        Thread t2 = new Thread(() -> {
            sleep(1);
            log.debug("洗茶壶");
            sleep(3);
            log.debug("洗茶杯");
            sleep(1);
            log.debug("拿茶叶");
            try {
                t1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug("泡茶");
        },"小王");
        t1.start();
        t2.start();
    }
}